import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class FileInpuStreamDemo01 {
    public static void main(String[] args) {
        FileInputStream input = null;
        try {

            // 创建一个字节流对象
            input = new FileInputStream("C:\\Users\\Administrator\\Desktop\\1.txt");
            int content = input.read();
            System.out.println(content);
            int content1 = input.read();
            System.out.println(content1);
            int content2 = input.read();
            System.out.println(content2);


            int content3 = input.read();//-1
            System.out.println(content3);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if(input != null){
                try {
                    input.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
